package main

import "fmt"

var ga int
var gb int = 1
var gc = 1

// gd := 1.2 // 全局变量不支持这样声明 会报错

func main2() {
	var a int
	fmt.Printf("a is %s, type of a is %T\n", a, a)

	var b int = 1 // 一般不用这种带类型的，常见是推导
	fmt.Printf("b is %s, type of b is %T\n", b, b)

	var c = "aaa"
	fmt.Printf("c is %s, type of c is %T\n", c, c)

	d := 1.2
	fmt.Printf("d is %s, type of d is %T\n", d, d)

	// 多变量声明 类型相同可以加int
	var xx, yy int = 1, 2
	fmt.Println(xx, yy)
	var kk, ll = 1, "aa"
	fmt.Println(kk, ll)

	var (
		xxx int = 2
		yyy     = "bb"
		zzz     = true
	)
	fmt.Println(xxx, yyy, zzz)

}
